import request from "@/utils/request";

export function getNavList() {
  return request({
    url: "/a/h/NavigationItem/list",
    method: "get"
  });
}
export function getCourse(params) {
  return request({
    url: "/a/h/course/list",
    method: "get",
    params: params
  });
}
export function getCourseReco() {
  return request({
    url: "/a/h/course/list/recommend",
    method: "get"
  });
}
export function getCourseDetail(id) {
  return request({
    url: "/a/h/course/" + id,
    method: "get"
  });
}
export function getCourseComment(id) {
  return request({
    url: "/a/h/coursecomment/list/" + id,
    method: "get"
  });
}
export function getCourseCommentDetail(id) {
  return request({
    url: "/a/h/coursecomment/" + id,
    method: "get"
  });
}
export function getUserInfo() {
  return request({
    url: "/a/h/api/user",
    method: "get"
  });
}
export function login() {
  return request({
    url: "/a/h/login",
    method: "post"
  });
}
export function register(params) {
  return request({
    url: "/a/h/register",
    method: "post",
    params: params
  });
}
export function getUserInfoDetail() {
  return request({
    url: "/a/h/api/user/baseinfo",
    method: "get"
  });
}
export function getPersonalComment(params) {
  return request({
    url: "/a/h/api/user/homepage/coursecomment",
    method: "get",
    params: params
  });
}
export function getCourseCollection(params) {
  return request({
    url: "/a/h/api/user/homepage/coursecollection",
    method: "get",
    params: params
  });
}
export function getFollower(params) {
  return request({
    url: "/a/h/api/user/followers",
    method: "get",
    params: params
  });
}
export function getfollowing(params) {
  return request({
    url: "/a/h/api/user/following",
    method: "get",
    params: params
  });
}
export function saveCollect(id,params) {
  return request({
    url: `/a/h/course/${id}/api/collection`,
    method: "post",
    params:params||{}
  });
}
export function followerthisUser(params) {
  return request({
    url: "/a/h/api/user/uurelation",
    method: "post",
    params: params||{}
  });
};
export function commentothers(params) {
  return request({
    url: "/a/h/api/comment",
    method: "post",
    params: params||{}
  });
};
export function getcommentList(id,params) {
  return request({
    url: `/a/h/comment/list/${id}`,
    method: "get",
    params: params||{}
  });
};
export function changePassWord(params) {
  return request({
    url: `/a/h/api/user/pwd`,
    method: "put",
    data: params||{}
  });
};